import 'package:casdon/modules/lifeCircle/data/model/life_topic_module.dart';

class LifeTopicListState {
  final List<LifeTopicModule>? data;
  final int totalSize;
  final int page;
  final int pageSize;
  final bool isLoadingMore;
  final bool hasMore;

  LifeTopicListState copyWith({
    List<LifeTopicModule>? data,
    int? totalSize,
    int? page,
    int? pageSize,
    bool? isLoadingMore,
    bool? hasMore,
  }) {
    return LifeTopicListState(
      data: data ?? this.data,
      totalSize: totalSize ?? this.totalSize,
      page: page ?? this.page,
      pageSize: pageSize ?? this.pageSize,
      isLoadingMore: isLoadingMore ?? this.isLoadingMore,
      hasMore: hasMore ?? this.hasMore,
    );
  }

  factory LifeTopicListState.initial() => LifeTopicListState(
    data: [],
    totalSize: 0,
    page: 0,
    pageSize: 1,
    isLoadingMore: false,
    hasMore: false,
  );

  LifeTopicListState({
    required this.data,
    required this.totalSize,
    required this.page,
    required this.pageSize,
    required this.isLoadingMore,
    required this.hasMore,
  });
}
